<!doctype html>
<html>
<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/common.css" />
		<style>
			h5 {
				color: #A1A1A1 !important;
				border-bottom: 1px solid #CCCCCC;
				padding-bottom: 5px;
			}
			#more_info_box{
				color: #333333;
			}
			/*艺人详细信息表格*/
			.details_table {
				text-align: center;
				font-size: 14px;
				width: 100%;
				background-color: #efeff4;
			}
			/*表格数据*/
			.details_table tr td {
				height: 30px;
				line-height: 30px;
				color: #9C9C9C;
				background-color: white;
				border: solid 3px #efeff4;
			}
			/*表格头标题*/
			.details_table tr th {
				font-weight: normal;
				height: 30px;
				line-height: 30px;
			}
			
			.my_more_data{
				color: #999999;
				float: right;
			}
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-back mui-icon-left-nav mui-pull-left"></a>
			<a class="mui-pull-right">编辑</a>
			<h1 class="mui-title">更多信息</h1>
		</header>
		<div class="mui-content">
			<div id="more_info_box">
				<h5 class="min-title">详细信息</h5>
				<table class="details_table" cellspacing="10">
					<tr>
						<th>出生日期</th>
						<th>星座</th>
						<th>血型</th>
					</tr>
					<tr>
						<td id="birthday"></td>
						<td id="constellation"></td>
						<td id="bloodType"></td>
					</tr>
					<tr>
						<th>身高(cm)</th>
						<th>体重(kg)</th>
						<th>毕业院校</th>
						<!--<th>三围(cm)</th>-->
					</tr>
					<tr>
						<td id="stature"></td>
						<td id="weight"></td>
						<td id="graduateSchool"></td>
						<!--<td id="bwh"></td>-->
					</tr>
					<tr>
						
						<th>学历</th>
						<th>从业年限</th>
					</tr>
					<tr>
						
						<td id="educationalBackground"></td>
						<td><span id="artisticCareer"></span>年</td>
					</tr>
				</table>
				<ul class="mui-table-view">
					<li class="mui-table-view-cell">
						性别<span id="sex" class="my_more_data"></span>
					</li>
					<li class="mui-table-view-cell">
						所在城市<span id="city" class="my_more_data"></span>
					</li>
					<li class="mui-table-view-cell">
						详细地址<span id="address" class="my_more_data"></span>
					</li>
					
				</ul>
			</div>
		</div>
		
	</body>
	<script src="../js/mui.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="../js/jquery.min.js" ></script>
	<script src="../js/common.js" type="text/javascript" charset="utf-8"></script>
	<script src="../js/user.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		
		//获取传递过来的数据并显示
		mui.plusReady(function(){
			var moreinfo = plus.webview.currentWebview();
			console.log(JSON.stringify(moreinfo.moreinfojstr));
			//遍历json串
			$.each(moreinfo.moreinfojstr, function(i, o) {
				$("#" + i).text(o);
			});
		});
		
		//编辑页面
		//获取页面数据函数
		var ioarr = {};
		function GetMyMoreInfoData(idarr){
			var len = idarr.length;
			for(var i=0; i <= len -1 ; i++){
//				console.log(i + idarr[i]);
				ioarr[idarr[i]] = document.getElementById(idarr[i]).innerHTML;
			}
		}
		mui('header').on('tap','.mui-pull-right',function(){
			//获取页面数据并传递
			var myidarr = ['birthday','constellation','bloodType','stature','weight','graduateSchool','educationalBackground','artisticCareer','sex','city','address'];
			GetMyMoreInfoData(myidarr);
//			console.log(JSON.stringify(ioarr));
			Common.openWindow('compile-my-moreinfo.html',{pdata:ioarr});
		})
		
		//监听编辑详细信息页面mymoreinfochange事件
		document.addEventListener('mymoreinfochange',function(){
			var url = baseURL + 'selfInfo/start.json?uid=99704d5c001d45ce912b35ac47ea4127';
			Common.ajax({
				url : url
			}, function(data) {
				console.log(JSON.stringify(data));
				var data = data.artistInfo;
				console.log(JSON.stringify(data));
				$.each(data, function(i, o) {
					if(/^(birthday|constellation|bloodType|stature|weight|graduateSchool|educationalBackground|artisticCareer|sex|city|address)$/.test(i)) {
						$("#" + i).text(o);
					}
				});
			}, function(xhr) {
				mui.toast('网络异常，请稍后再试');
				console.error('failed - ' + xhr.status + ' : ' + xhr.statusText);
			})
		})
	</script>
</html>